package com.errol.batchprocessor.employeeaddition.advisorimpl.payroll.payload;

import com.renjia.entity.BusPayrollRecordDetail;
import com.renjia.service.module.employeeaddition.advisorimpl.common.payload.AbstractEmployeePiecePayload;
import com.renjia.util.caculatepayroll.CalculatePayrollResult;
import lombok.Getter;

import java.math.BigDecimal;
import java.util.List;

/**
 * 费用发放导入分片数据
 *
 * @author zhang xiao bin
 * @version v1.0
 * @date 2021/03/03
 * @since v5.0.6
 **/
@Getter
public class PayrollEmployeePiecePayload extends AbstractEmployeePiecePayload<BusPayrollRecordDetail, PayrollEmployeeSinglePayload> {

    private final CalculatePayrollResult failedCalculatePayrollResult;
    private int personNumber;

    public PayrollEmployeePiecePayload(List<PayrollEmployeeSinglePayload> singlePayloadList) {
        super(singlePayloadList);
        personNumber = 0;
        this.failedCalculatePayrollResult = new CalculatePayrollResult();
        this.failedCalculatePayrollResult.setPersonalShouldSalary(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setShouldPayAmount(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setShouldPayBrokerage(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setShouldPaySalary(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setInfactPayAmount(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setInfactPayBrokerage(BigDecimal.ZERO);
        this.failedCalculatePayrollResult.setInfactPaySalary(BigDecimal.ZERO);
    }

    public void setPersonNumber(int personNumber) {
        this.personNumber = personNumber;
    }
}
